<?php	
	include "../../public/commom/config.php";
	include "../lock2.php";
?>

<!DOCTYPE html>
<html>
	
	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.1.0/css/bootstrap.min.css">
	</head>
	
	<body>
		<h1>添加新闻</h1>
		<form action="add1.php" method="post">
			<label>
				分类
				<select name="class_id">
					<?php 
						$sql = "SELECT * FROM class";
						
						$result = mysqli_query($conn, $sql);
						
						while($row = mysqli_fetch_array($result)) {
							echo "<option value=" . $row["id"] . ">" . $row["name"] . "</option>";
						}
						
						mysqli_close($conn);
					?>
				</select>
			</label>
			<label>
				标题
				<input type="text" name="title" placeholder="请输入标题..." autocomplete="off" />
			</label>
			<label>
				内容
				<input type="text" name="content" placeholder="请输入内容..." autocomplete="off" />
			</label>
			<input type="submit" value="添加"/>
		</form>
	</body>
	
</html>